package edu.nf.project.services.storeOperation.impl;

import edu.nf.project.entitys.entity.storeOperation.convention.operate.CustomerOrderItem;
import edu.nf.project.mappers.storeOperation.convention.CustomerOrderItemMapper;
import edu.nf.project.services.storeOperation.CustomerOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerOrderItemServiceImpl implements CustomerOrderItemService {
    @Autowired
    private CustomerOrderItemMapper customerOrderItemMapper;

    @Override
    public Boolean addItem(Integer orderId, Integer dishId, Integer quantity) {
        CustomerOrderItem customerOrderItem = new CustomerOrderItem();
        customerOrderItem.setOrderId(orderId);
        customerOrderItem.setDishId(dishId);
        customerOrderItem.setQuantity(quantity);
        return customerOrderItemMapper.insert(customerOrderItem) > 0;
    }
}
